//
//	ObjModel.swift
//
//	Create by 松 松 on 13/5/2019
//	Copyright © 2019. All rights reserved.
//	Model file generated using JSONExport: https://github.com/Ahmed-Ali/JSONExport

import Foundation


open class ObjModel : NSObject, NSCoding, SSMap{

	public var obj : String!


	/**
	 * Instantiate the instance using the passed dictionary values to set the properties values
	 */
    required public init(fromDictionary dictionary: [String:Any]){
		obj = dictionary["obj"] as? String
	}

	/**
	 * Returns all the available property values in the form of [String:Any] object where the key is the approperiate json key and the value is the value of the corresponding property
	 */
    public func toDictionary() -> [String:Any]
	{
		var dictionary = [String:Any]()
		if obj != nil{
			dictionary["obj"] = obj
		}
		return dictionary
	}

    /**
    * NSCoding required initializer.
    * Fills the data from the passed decoder
    */
    @objc required public init(coder aDecoder: NSCoder)
	{
         obj = aDecoder.decodeObject(forKey: "obj") as? String

	}

    /**
    * NSCoding required method.
    * Encodes mode properties into the decoder
    */
    @objc public func encode(with aCoder: NSCoder)
	{
		if obj != nil{
			aCoder.encode(obj, forKey: "obj")
		}

	}

}

open class ObjBoolModel : NSObject, NSCoding, SSMap{

    public var obj : Bool!


    /**
     * Instantiate the instance using the passed dictionary values to set the properties values
     */
    required public init(fromDictionary dictionary: [String:Any]){
        obj = dictionary["obj"] as? Bool
    }

    /**
     * Returns all the available property values in the form of [String:Any] object where the key is the approperiate json key and the value is the value of the corresponding property
     */
    public func toDictionary() -> [String:Any]
    {
        var dictionary = [String:Any]()
        if obj != nil{
            dictionary["obj"] = obj
        }
        return dictionary
    }

    /**
     * NSCoding required initializer.
     * Fills the data from the passed decoder
     */
    @objc required public init(coder aDecoder: NSCoder)
    {
        obj = aDecoder.decodeObject(forKey: "obj") as? Bool

    }

    /**
     * NSCoding required method.
     * Encodes mode properties into the decoder
     */
    @objc public func encode(with aCoder: NSCoder)
    {
        if obj != nil{
            aCoder.encode(obj, forKey: "obj")
        }

    }

}


open class ObjDataModel<T:SSMap> : NSObject, NSCoding, SSMap{

    public var obj : T!


    /**
     * Instantiate the instance using the passed dictionary values to set the properties values
     */
    required public init(fromDictionary dictionary: [String:Any]){
        if let objData = dictionary["obj"] as? [String:Any]{
            obj = T(fromDictionary: objData)
        }
    }

    /**
     * Returns all the available property values in the form of [String:Any] object where the key is the approperiate json key and the value is the value of the corresponding property
     */
    public func toDictionary() -> [String:Any]
    {
        var dictionary = [String:Any]()
        if obj != nil{
            dictionary["obj"] = obj.toDictionary()
        }
        return dictionary
    }

    /**
     * NSCoding required initializer.
     * Fills the data from the passed decoder
     */
    @objc required public init(coder aDecoder: NSCoder)
    {
        obj = aDecoder.decodeObject(forKey: "obj") as? T

    }

    /**
     * NSCoding required method.
     * Encodes mode properties into the decoder
     */
    @objc public func encode(with aCoder: NSCoder)
    {
        if obj != nil{
            aCoder.encode(obj, forKey: "obj")
        }

    }

}
